<xsl:transform
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 version="2.0"
 xmlns:xs="http://www.w3.org/2001/XMLSchema"
>

<xsl:template match="/document">
	<html>
	 
	<xsl:call-template name="html-header"/>
	 
	<body lang="RU">
	 
	<div class="Section1">
	 
	<xsl:call-template name="doc-header"/>
	 
	<p class="MsoNormal" style='text-indent:1.0cm'>Прошу выслать следующие документы:</p>
	
	<xsl:if test="normalize-space(date/reconciliation)='true'">
		<p class="MsoNormal" style='margin-left:46.35pt;text-indent:-18.0pt'>-<span
		style='font:7.0pt "Times New Roman"'>&#160;&#160;&#160;&#160;&#160; </span>Акт
		сверки с <xsl:value-of select='format-dateTime(
									xs:dateTime(date/reconcileFrom), "[D01].[M01].[Y0001]")'/> 
								по <xsl:value-of select='format-dateTime(
									xs:dateTime(date/reconcileTo), "[D01].[M01].[Y0001]")'/></p>
	</xsl:if>
	 
	<xsl:if test="normalize-space(date/spectrReport)='true'">
			<p class="MsoNormal" style='margin-left:46.35pt;text-indent:-18.0pt'>-<span
			style='font:7.0pt "Times New Roman"'>&#160;&#160;&#160;&#160;&#160; </span>Выписка
			из учетной БД на текущий момент</p>
	</xsl:if>
	 
	<!-- xsl:apply-templates select="invoicefactures"/> -->
	<xsl:if test="normalize-space(date/proformaInvoices)='true'">
		<p class="MsoNormal" style='margin-left:46.35pt;text-indent:-18.0pt'>-<span
		style='font:7.0pt "Times New Roman"'>&#160;&#160;&#160;&#160;&#160; </span>Акты выполненных работ и счета-фактуры с 
							<xsl:value-of select='format-dateTime(
										xs:dateTime(date/proformaFrom), "[D01].[M01].[Y0001]")'/> 
									по <xsl:value-of select='format-dateTime(
										xs:dateTime(date/proformaTo), "[D01].[M01].[Y0001]")'/></p>
	</xsl:if>
	
	<!-- xsl:apply-templates select="acts"/> -->
	 
	<!-- xsl:apply-templates select="invoices"/> -->
	<xsl:if test="normalize-space(date/invoices)='true'">
		<p class="MsoNormal" style='margin-left:46.35pt;text-indent:-18.0pt'>-<span
		style='font:7.0pt "Times New Roman"'>&#160;&#160;&#160;&#160;&#160; </span>Счета
		на оплату с <xsl:value-of select='format-dateTime(
										xs:dateTime(date/invoicesFrom), "[D01].[M01].[Y0001]")'/> 
									по <xsl:value-of select='format-dateTime(
										xs:dateTime(date/invoicesTo), "[D01].[M01].[Y0001]")'/></p>
	</xsl:if>
	 
	<p class="MsoNormal">&#160;</p>

	<p class="MsoNormal">Адрес доставки: <xsl:value-of select="normalize-space(date/address)"/></p>
	 
	<p class="MsoNormal">&#160;</p>
	 
	<p class="MsoNormal">&#160;</p>
	 
	<p class="MsoNormal">Должность&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;_______________&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ФИО</p>
	 
	<p class="MsoNormal" style='margin-left:233.9pt'>&#160;</p>
	 
	<p class="MsoNormal" style='margin-left:141.6pt;text-indent:35.4pt'>
		<xsl:value-of select='format-dateTime(
								xs:dateTime(outgoingDate), "[D01].[M01].[Y0001]")'/></p>
	 
	</div>
	 
	</body>
	 
	</html>

</xsl:template>

<xsl:template match="invoices">
	<p class="MsoNormal" style='margin-left:46.35pt;text-indent:-18.0pt'>-<span
	style='font:7.0pt "Times New Roman"'>&#160;&#160;&#160;&#160;&#160; </span>Счета
	на оплату</p>
	 
	<table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0"
	 style='margin-left:46.35pt;border-collapse:collapse;border:none'>
	 <tr>
	  <td width="59" valign="top" style='width:44.4pt;border:solid black 1.0pt;
	  padding:0cm 5.4pt 0cm 5.4pt'>
	  <p class="MsoNormal">Номер</p>
	  </td>
	  <td width="253" valign="top" style='width:190.05pt;border:solid black 1.0pt;
	  border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
	  <p class="MsoNormal">Предмет</p>
	  </td>
	  <td width="86" valign="top" style='width:64.8pt;border:solid black 1.0pt;
	  border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
	  <p class="MsoNormal">Дата</p>
	  </td>
	  <td width="113" valign="top" style='width:3.0cm;border:solid black 1.0pt;
	  border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
	  <p class="MsoNormal">Сумма, руб.</p>
	  </td>
	 </tr>
	 
	 <xsl:apply-templates select="invoice"/>
	 
	</table>
	 
	<p class="MsoNormal" style='margin-left:46.35pt'>&#160;</p>
</xsl:template>

<xsl:template match="acts">
	<p class="MsoNormal" style='margin-left:46.35pt;text-indent:-18.0pt'>-<span
	style='font:7.0pt "Times New Roman"'>&#160;&#160;&#160;&#160;&#160; </span>Акты
	выполненных работ</p>
	 
	<table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0"
	 style='margin-left:46.35pt;border-collapse:collapse;border:none'>
	 <tr>
	  <td width="59" valign="top" style='width:44.4pt;border:solid black 1.0pt;
	  padding:0cm 5.4pt 0cm 5.4pt'>
	  <p class="MsoNormal">Номер</p>
	  </td>
	  <td width="255" valign="top" style='width:191.1pt;border:solid black 1.0pt;
	  border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
	  <p class="MsoNormal">Предмет</p>
	  </td>
	  <td width="85" valign="top" style='width:63.75pt;border:solid black 1.0pt;
	  border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
	  <p class="MsoNormal">Дата</p>
	  </td>
	  <td width="113" valign="top" style='width:3.0cm;border:solid black 1.0pt;
	  border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
	  <p class="MsoNormal">Сумма, руб.</p>
	  </td>
	 </tr>
	 
	 <xsl:apply-templates select="act"/>

	</table>
	 
	<p class="MsoNormal" style='margin-left:46.35pt'>&#160;</p>
</xsl:template>

<xsl:template match="invoicefactures">
	<p class="MsoNormal" style='margin-left:46.35pt;text-indent:-18.0pt'>-<span
	style='font:7.0pt "Times New Roman"'>&#160;&#160;&#160;&#160;&#160; </span>Счета-фактуры</p>
	 
	<table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0"
	 style='margin-left:46.35pt;border-collapse:collapse;border:none'>
	 <tr>
	  <td width="59" valign="top" style='width:44.4pt;border:solid black 1.0pt;
	  padding:0cm 5.4pt 0cm 5.4pt'>
	  <p class="MsoNormal">Номер</p>
	  </td>
	  <td width="253" valign="top" style='width:190.05pt;border:solid black 1.0pt;
	  border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
	  <p class="MsoNormal">Предмет</p>
	  </td>
	  <td width="86" valign="top" style='width:64.8pt;border:solid black 1.0pt;
	  border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
	  <p class="MsoNormal">Дата</p>
	  </td>
	  <td width="113" valign="top" style='width:3.0cm;border:solid black 1.0pt;
	  border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
	  <p class="MsoNormal">Сумма, руб.</p>
	  </td>
	 </tr>
	 
	 <xsl:apply-templates select="invoice"/>

	</table>
	 
	<p class="MsoNormal" style='margin-left:46.35pt'>&#160;</p>
</xsl:template>

<xsl:template match="invoice | act">
	 <tr>
	  <td width="59" valign="top" style='width:44.4pt;border:solid black 1.0pt;
	  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
	  <p class="MsoNormal"><xsl:value-of select="normalize-space(number)"/></p>
	  </td>
	  <td width="253" valign="top" style='width:190.05pt;border-top:none;border-left:
	  none;border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;
	  padding:0cm 5.4pt 0cm 5.4pt'>
	  <p class="MsoNormal"><xsl:value-of select="normalize-space(name)"/></p>
	  </td>
	  <td width="86" valign="top" style='width:64.8pt;border-top:none;border-left:none;
	  border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;padding:0cm 5.4pt 0cm 5.4pt'>
	  <p class="MsoNormal"><xsl:value-of select='format-dateTime(
								xs:dateTime(date), "[D01].[M01].[Y0001]")'/></p>
	  </td>
	  <td width="113" valign="top" style='width:3.0cm;border-top:none;border-left:none;
	  border-bottom:solid black 1.0pt;border-right:solid black 1.0pt;padding:0cm 5.4pt 0cm 5.4pt'>
	  <p class="MsoNormal"><xsl:apply-templates select="amount | amounttotal"/></p>
	  </td>
	 </tr>
</xsl:template>

<xsl:template match="amount | amounttotal">
	<xsl:value-of select="format-number(
							number(normalize-space(.)),
							'####.00')"/>
</xsl:template>

<xsl:template name="doc-header">
	<p class="MsoNormal" style='margin-left:212.65pt'>Генеральному директору</p>
	 
	<p class="MsoNormal" style='margin-left:212.65pt'>ФГУП «РЧЦ УрФО»</p>
	 
	<p class="MsoNormal" style='margin-left:212.65pt'><span lang="EN-US">&#160;</span></p>
	 
	<p class="MsoNormal" style='margin-left:212.65pt'>Б.М. Егорову</p>
	<!-- 
	 
	<p class="MsoNormal" style='margin-left:212.65pt'><b>&#160;</b></p>
	 
	<p class="MsoNormal" style='margin-left:212.65pt'>&#160;</p>
	 
	<p class="MsoNormal" style='margin-left:212.65pt'><span lang="EN-US">o</span>т  <xsl:value-of select="normalize-space(contragent/name)"/></p>
	 -->
	 
	<p class="MsoNormal" style='margin-left:283.45pt;text-indent:35.15pt'>&#160;</p>
	 
	<p class="MsoNormal">&#160;</p>
	 
	<p class="MsoNormal">&#160;</p>
	 
	<p class="MsoNormal"><b><span style='font-size:14.0pt'>&#160;</span></b></p>
	 
	<p class="MsoNormal"><b><span style='font-size:14.0pt'>&#160;</span></b></p>
</xsl:template>

<xsl:template name="html-header">
	<head>
	<title>Заказ документов</title>
	<style><![CDATA[
	<!--
	 /* Font Definitions */
	 @font-face
		{font-family:"Cambria Math";
		panose-1:2 4 5 3 5 4 6 3 2 4;}
	@font-face
		{font-family:Cambria;
		panose-1:2 4 5 3 5 4 6 3 2 4;}
	@font-face
		{font-family:Tahoma;
		panose-1:2 11 6 4 3 5 4 4 2 4;}
	 /* Style Definitions */
	 p.MsoNormal, li.MsoNormal, div.MsoNormal
		{margin:0cm;
		margin-bottom:.0001pt;
		font-size:12.0pt;
		font-family:"Times New Roman","serif";}
	h1
		{mso-style-link:"Заголовок 1 Знак";
		margin:0cm;
		margin-bottom:.0001pt;
		page-break-after:avoid;
		font-size:12.0pt;
		font-family:"Times New Roman","serif";}
	h3
		{mso-style-link:"Заголовок 3 Знак";
		margin-top:12.0pt;
		margin-right:0cm;
		margin-bottom:3.0pt;
		margin-left:0cm;
		page-break-after:avoid;
		font-size:13.0pt;
		font-family:"Arial","sans-serif";}
	p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
		{mso-style-link:"Текст выноски Знак";
		margin:0cm;
		margin-bottom:.0001pt;
		font-size:8.0pt;
		font-family:"Tahoma","sans-serif";}
	span.1
		{mso-style-name:"Заголовок 1 Знак";
		mso-style-link:"Заголовок 1";
		font-family:"Cambria","serif";
		font-weight:bold;}
	span.3
		{mso-style-name:"Заголовок 3 Знак";
		mso-style-link:"Заголовок 3";
		font-family:"Cambria","serif";
		font-weight:bold;}
	span.a
		{mso-style-name:"Текст выноски Знак";
		mso-style-link:"Текст выноски";
		font-family:"Tahoma","sans-serif";}
	@page Section1
		{size:595.3pt 841.9pt;
		margin:2.0cm 42.5pt 2.0cm 3.0cm;}
	div.Section1
		{page:Section1;}
	 /* List Definitions */
	 ol
		{margin-bottom:0cm;}
	ul
		{margin-bottom:0cm;}
	-->]]>
	</style>
	 
	</head>
</xsl:template>

<xsl:template name="doc-footer">
</xsl:template>

</xsl:transform>	
